package org.shj.util;

import java.io.InputStream;
import java.util.Properties;

public class PropertyUtils {

	private Properties properties = new Properties();
	
	private PropertyUtils(){
		try(InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("jdbc.properties")){
			properties.load(is);
		}catch(Exception e){
			e.printStackTrace();
		}
	}
	
	private static PropertyUtils propertyUtils = new PropertyUtils();
	
	public static PropertyUtils getInstance(){
		return propertyUtils;
	}
	
	public String get(String key){
		return properties.getProperty(key);
	}
	
	public static void main(String[] args) {
		System.out.println(PropertyUtils.getInstance().get("driver.class"));
	}
}
